﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SMS.Core.Model.Data
{
    public class AppDataCache
    {
        #region Constructors

        protected AppDataCache()
        {
            InitializeAppDataCache();
        }

        #endregion

        #region Members

        private static AppDataCache m_instance = new AppDataCache();

        private static object m_staticSyncRoot = new Object();
        // UNDONE: The data model needs more work.
        private AppData m_appData;

        #endregion

        #region Public Methods

        public static AppDataCache Instance
        {
            get
            {
                if (m_instance == null)
                {
                    lock (m_staticSyncRoot)
                    {
                        if (m_instance == null) m_instance = new AppDataCache();
                    }
                }

                return m_instance;
            }
        }

        public AppData Data
        {
            get
            {
                return m_appData;
            }
        }

        #endregion

        #region Non-Public Methods

        private void InitializeAppDataCache()
        {
            m_appData = new AppData();
        }

        #endregion
    }
}